<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{ title }} - {{ company }}</title>
    <link href="{{ static_url('css/bootstrap.min.css') }}" rel="stylesheet">
    <!--[if lt IE 9]>
      <script src="{{ static_url('js/html5shiv.min.js') }}"></script>
      <script src="{{ static_url('js/respond.min.js') }}"></script>
    <![endif]-->
    <script src="{{ static_url('js/jquery.min.js') }}"></script>
    {% block head %}
    {% end %}
    <link href="{{ static_url('css/style.css') }}" rel="stylesheet">
</head>
<body>
<header>
    <nav class="navbar navbar-inverse navbar-fixed-top">
          <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                        aria-expanded="false" aria-controls="navbar">
                    <span class="sr-only">导航开关</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="/admin/dashboard">{{ company }}</a>
            </div>
            <div id="navbar" class="navbar-collapse collapse" aria-expanded="false" style="height: 1px;">
                <ul class="nav navbar-nav navbar-right">
                    <li><a>你好, {% if current_user and current_user.nickname != '' %}{{ current_user.nickname }}{% elif current_user %}{{ current_user.email }}{% else %}Guest{% end %}</a></li>
                    <li id="dashboard"><a href="/admin/dashboard">控制台</a></li>
                    <li id="plugin"><a href="/admin/plugin">测试数据构造工具</a></li>
                    <li id="interface-test"><a href="/admin/interface-test">接口测试</a></li>
                    <li id="page-test"><a href="/admin/page-test">页面监控</a></li>
                    <li id="setting"><a href="/admin/setting">设置</a></li>
                    <li id="profile"><a href="/admin/profile">个人信息</a></li>
                    <li><a href="/help" target="_blank">帮助</a></li>
                    {% if current_user and current_user.role != 2 %}
                    <li id="manage"><a href="/admin/manage">管理后台</a></li>
                    {% end %}
                    <li><a href="/admin/logout">退出</a></li>
                </ul>
            </div>
          </div>
    </nav>
</header>
<section>
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-2 col-md-2 col-lg-1 sidebar" id="sidebar" data-op="{{ op }}">
                {% block sidebar %}
                {% end %}
            </div>
            <div class="col-sm-10 col-sm-offset-2 col-md-10 col-lg-11 col-md-offset-2 col-lg-offset-1 main">
                <ol class="breadcrumb">
                    <li id="nav-name"><a></a></li>
                    <li id="sub-nav-name" class="active"></li>
                </ol>
                <div class="container-fluid well">
                    {% block section %}
                    {% end %}
                </div>
            </div>
        </div>
    </div>
</section>
<footer>
    <script src="{{ static_url('js/bootstrap.min.js') }}"></script>
    <script src="{{ static_url('js/jquery.validate.min.js') }}"></script>
    <script src="{{ static_url('js/localization/messages_zh.min.js') }}"></script>
    <script src="{{ static_url('js/func.js') }}"></script>
    {% block footer %}
    {% end %}
    <script>
    $(document).ready(function(){
        var op = $("#sidebar").attr("data-op"),
            nav = location.href.split('/')[4];
        if(nav != undefined){
            $("#"+nav).addClass('active');
            $(".breadcrumb #nav-name a").text($("#"+nav+" a").text());
            $(".breadcrumb #nav-name a").attr("href", $("#"+nav+" a").attr("href"));
        }
        if(op != undefined){
            $("#"+op).addClass('active');
            $(".breadcrumb #sub-nav-name").text($("#"+op+" a").text());
        }
    });
    </script>
</footer>
</body>
</html>